var t = getApp(), e = require("../../utils/sendpic.js");

Page({
    data: {
        formId: "",
        id: "",
        ra1: "",
        ra2: "",
        ra3: "",
        htbase: "",
        condition: !0,
        img: "../../images/06.png",
        pic: "../../images/20.png",
        canIu: !1
    },
    onLoad: function(e) {
        this.setData({
            id: e.id,
            htbase: e.htbase
        }), wx.getStorageSync("CsTelphone") || t.GetUrl(), 1 == wx.canIUse("button.open-type.contact") && this.setData({
            canIu: !0
        });
    },
    upload: function(t) {
        var e = this, o = wx.getStorageSync("strpicname");
        o && o.length > 0 ? wx.showModal({
            title: "提示",
            content: "你之前曾上传合同照片，但尚未支付，你可选择'前往支付'或者'重新上传'：",
            confirmText: "前往支付",
            cancelText: "重新上传",
            success: function(t) {
                t.confirm ? wx.redirectTo({
                    url: "../Examprice/Examprice?From=1&Amount=" + wx.getStorageSync("Amount")
                }) : (wx.removeStorage({
                    key: "strpicname"
                }), e.chooseImageUp());
            }
        }) : this.chooseImageUp();
    },
    chooseImageUp: function() {
        var t = this, o = this.data.Amount;
        !o || o.length <= 0 ? wx.showModal({
            title: "提示",
            content: "你没有选择价格，请回到界面选择价格！",
            showCancel: !1,
            success: function(t) {
                t.confirm ? console.log("用户点击确定") : t.cancel && console.log("用户点击取消");
            }
        }) : wx.chooseImage({
            count: 9,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(o) {
                var n = o.tempFilePaths;
                e.sendPhotos(n), wx.setStorageSync("Amount", t.data.Amount);
            }
        });
    },
    backto: function() {
        wx.navigateBack({
            delta: -1
        });
    },
    ExamPay: function(t) {
        t.detail.formId;
        var e = this.data.Amount;
        !e || e.length <= 0 ? wx.showModal({
            title: "提示",
            content: "你没有选择价格，请回到界面选择价格！",
            showCancel: !1,
            success: function(t) {
                t.confirm ? console.log("用户点击确定") : t.cancel && console.log("用户点击取消");
            }
        }) : wx.redirectTo({
            url: "../Examprice/Examprice?Amount=" + e + "&id=" + this.data.id + "&From=2&htbase=" + this.data.htbase
        });
    },
    radioChange: function(t) {
        this.setData({
            Amount: t.detail.value
        });
    },
    Operate: function() {
        var t = this;
        wx.showActionSheet({
            itemList: [ "拨打电话", "委托须知" ],
            success: function(e) {
                console.log(e.tapIndex), 0 == e.tapIndex && t.callus(), 1 == e.tapIndex && t.wxAddNote();
            },
            fail: function(t) {
                console.log(t.errMsg);
            }
        });
    },
    callus: function() {
        wx.makePhoneCall({
            phoneNumber: wx.getStorageSync("CsTelphone")
        });
    },
    wxAddNote: function() {
        this.setData({
            condition: !1,
            CsWxnum: wx.getStorageSync("CsWxnum")
        });
    },
    closeCluepage: function() {
        this.setData({
            condition: !0
        });
    }
});